package com.useoften;

import java.util.Date;

public class TestDate {
    public static void main(String[] args) {
        long nowNum = System.currentTimeMillis();
        System.out.println(nowNum);

        Date date1 = new Date(10000007998L);
        System.out.println(date1);
        System.out.println(date1.getTime());

        Date date2 = new Date(21L*365*24*3600*1000);
        System.out.println(date2);
        System.out.println(date2.equals(date1));//通过getTime()比较
        System.out.println(date2.before(date1));//date2是否在date1之前
        System.out.println(date2.after(date1));//date2是否在date1之后
    }
}
